package cn.yerly.sakura.repository;

import cn.yerly.sakura.domain.Trade;
import org.springframework.data.jpa.repository.*;

import java.util.List;

/**
 * Spring Data JPA repository for the Trade entity.
 */
public interface TradeRepository extends JpaRepository<Trade,Long> {

    @Query("select trade from Trade trade where trade.user.login = ?#{principal.username}")
    List<Trade> findAllForCurrentUser();

}
